<template>
  <div class="page-container-inner no-scrollbar" v-if="!scroll">
    <slot></slot>
  </div>
  <Scrollbar v-else>
    <div class="page-container-inner in-scrollbar">
      <slot></slot>
    </div>
  </Scrollbar>
</template>

<script>
import Scrollbar from '@/components/Scrollbar';
/**
 Author: 蒋鑫强
 Time: 2023/6/2
 Description:
 */
export default {
  name: 'Page',
  components: {Scrollbar},
  props: {
    scroll: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style lang="less" scoped>
.page-container-inner {
  box-sizing: border-box;
  padding: 10px;

  &.in-scrollbar {
    min-width: 1000px;
    min-height: 600px;
  }

  &.no-scrollbar {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    :deep(.datagrid-container) {
      flex: 1;
      overflow: hidden;
    }
  }
}
</style>
